package com.feature.core.util;

import org.slf4j.MDC;

public class TraceIdUtil {
	public static final String TRACE_ID = "traceId";

	public static String createTraceID() {
		String traceId = UuidUtil.getSimpleUUID();
		MDC.put(TRACE_ID, traceId);
		return traceId;
	}

	public static String setTraceID(String traceId) {
		MDC.put(TRACE_ID, traceId);
		return traceId;
	}

	public static String getTraceId() {
		return MDC.get(TRACE_ID);
	}

	public static void clear() {
		MDC.clear();
	}
}
